<!DOCTYPE html>
<html lang="zh">

	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width,initial-scale=1">
		<link rel="icon" href="/favicon.ico">
		<title>发布求购-橙子校园</title>
		<meta name="keywords" content="校园二手,校园二手市场,大学二手,大学二手市场,大学生二手,大学二手网站,校园二手网站,校园二手app,桂林二手,桂林校园二手">
		<meta name="description" content="橙子校园网是由柚子校园团队开发的一个高校校园综合性的二手交易平台，校园二手网、大学生二手市场、大学生二手网，覆盖多所大学的大学生。涵盖二手手机、二手自行车、二手电动车、二手教材、二手书、二手电脑、二手数码产品等校园二手信息，满足大学生校园内的二手交易、二手求购的需求。买卖二手，尽在橙子校园">
		<link href="css/chunk-vendors.ca268116.css" rel="stylesheet">
		<link href="css/app.d8065f99.css" rel="stylesheet">
		<link rel="stylesheet" type="text/css" href="css/chunk-b5de9562.dd7e6dd9.css">
		<script charset="utf-8" src="js/chunk-b5de9562.ee00ad8d.js"></script>
		<link rel="stylesheet" type="text/css" href="css/chunk-31acb4cd.4690c08c.css">
		<script charset="utf-8" src="js/chunk-31acb4cd.2d86e333.js"></script>
		<link rel="stylesheet" type="text/css" href="css/chunk-4b1544d0.a9b19322.css">
		<script charset="utf-8" src="js/chunk-4b1544d0.805cdbf0.js"></script>
		<link rel="stylesheet" type="text/css" href="css/chunk-db1da7f8.7ce14588.css">
		<script charset="utf-8" src="js/chunk-db1da7f8.493d21ce.js"></script>
		<link rel="stylesheet" type="text/css" href="css/chunk-8d0479d4.b60dd502.css">
		<script charset="utf-8" src="js/chunk-8d0479d4.a3d7b29e.js"></script>
		<link rel="stylesheet" type="text/css" href="css/chunk-60050edb.5617662c.css">
		<script charset="utf-8" src="js/chunk-60050edb.530116be.js"></script>
		<!--导入vue和ajax-->
		<link rel="stylesheet" type="text/css" href="http://www.layuicdn.com/layui/css/layui.css"/>
		<script src="https://www.layuicdn.com/layui/layui.js"></script>
		<script type="text/javascript" src="https://lib.baomitu.com/vue/2.6.12/vue.min.js"></script>
		<script type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/axios/0.12.0/axios.min.js"></script>
		<script type="text/javascript" src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
	</head>

	<body>
		<div data-v-6505e6d8="" id="app">
			<!---->
			<div data-v-226c5ffb="" data-v-6505e6d8="" class="wrap">
				<div data-v-226c5ffb="" class="top"><img data-v-226c5ffb="" src="img/school_choose.d248fb38.png"></div>
				<div data-v-226c5ffb="" class="inner">
					<div data-v-226c5ffb="" class="content-box">
						<h2 data-v-226c5ffb="" class="text-center title">发布求购</h2>
						<form data-v-226c5ffb="" autocomplete="off" class="ivu-form ivu-form-label-right">
							<div data-v-226c5ffb="" class="ivu-form-item"><label class="ivu-form-item-label" style="width: 80px;">标题</label>
								<div class="ivu-form-item-content" style="margin-left: 80px;">
									<div data-v-226c5ffb="" class="ivu-input-wrapper ivu-input-wrapper-default ivu-input-type">
										<!---->
										<!----><i class="ivu-icon ivu-icon-ios-loading ivu-load-loop ivu-input-icon ivu-input-icon-validate"></i> <input autocomplete="off" spellcheck="false" type="text" placeholder="很重要,让别人对您的需求一目了然" class="ivu-input ivu-input-default" id="pname">
										<!---->
									</div>
									<!---->
								</div>
							</div>
							<div data-v-226c5ffb="" class="ivu-form-item"><label class="ivu-form-item-label" style="width: 80px;">简介(可选)</label>
								<div class="ivu-form-item-content" style="margin-left: 80px;">
									<div data-v-226c5ffb="" class="ivu-input-wrapper ivu-input-wrapper-default ivu-input-type"><textarea wrap="soft" autocomplete="off" spellcheck="false" placeholder="让别人更清晰了解您的需求" rows="2" class="ivu-input" style="height: 50px; min-height: 50px; max-height: 110px; overflow-y: hidden;" id="detail"></textarea></div>
									<!---->
								</div>
							</div>
							<div data-v-226c5ffb="" class="ivu-form-item"><label class="ivu-form-item-label" style="width: 80px;">可接受价格</label>
								<div class="ivu-form-item-content" style="margin-left: 80px;">
									<div data-v-226c5ffb="" class="ivu-input-wrapper ivu-input-wrapper-default ivu-input-type" style="width: 300px;">
										<!---->
										<!----><i class="ivu-icon ivu-icon-ios-loading ivu-load-loop ivu-input-icon ivu-input-icon-validate"></i> <input autocomplete="off" spellcheck="false" type="text" placeholder="数字或文字,可接受的价格,如'100-150之间'" class="ivu-input ivu-input-default" id="buyPrice">
										<!---->
									</div>
									<!---->
								</div>
							</div>
							<!--图片上传-->
							<div data-v-e53a43c0="" class="ivu-form-item"><label class="ivu-form-item-label"
																				 style="width: 80px;">图片上传</label>
								<div class="ivu-form-item-content" style="margin-left: 80px;">
									<div data-v-e53a43c0="" style="color: rgb(136, 136, 136);">
										请在上传前使用ps或者QQ截图对图片进行裁剪，才会不变形，更美观。推荐750*750px（像素）
									</div>
									<div class="layui-upload">
										<div data-v-e53a43c0="" class="demo-upload-list" style="display: none;">
											<img data-v-e53a43c0="" id="headImg">
											<div data-v-e53a43c0="" class="set-thumb">
												封面
											</div>
											<div data-v-e53a43c0="" class="demo-upload-list-cover">
												<i data-v-e53a43c0="" class="ivu-icon ivu-icon-ios-eye-outline"></i>
												<i data-v-e53a43c0="" class="ivu-icon ivu-icon-ios-trash-outline"></i>
											</div>
										</div>
										<div data-v-e53a43c0="" class="ivu-upload" style="display: inline-block; width: 100px;" id="headBtn">
											<div class="ivu-upload ivu-upload-drag">
												<input type="file" multiple="multiple"  class="ivu-upload-input">
												<div data-v-e53a43c0="" style="width: 100px; height: 100px; line-height: 100px;"><i
														data-v-e53a43c0="" class="ivu-icon ivu-icon-ios-camera"
														style="font-size: 30px; color: rgb(102, 102, 102);"></i></div>
											</div>
											<!---->
										</div>
									</div>


									<!---->
									<!---->
								</div>
							</div>
							<!--提交-->
							<div data-v-e53a43c0="" class="ivu-form-item">
								<!---->
								<div class="ivu-form-item-content" style="margin-left: 80px;">
									<button   type="button" class="ivu-btn ivu-btn-primary ivu-btn-long">
										<!----> <!----> <span @click="submit()" style="display: inline-block;width: 100%;height:100%;">提 交</span></button>
									<!---->
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
		<script>
			let image="";
			var v=new Vue({
				el:'#app',
				mounted(){
					//常规使用-普通图片上传
					layui.upload.render({
						elem:'#headBtn',
						url:'upload',//改成您自己上传的接口
						field:"head",
						done:function(res){
							//如果上传失败
							if(res.code==0){
								return layui.layer.msg('上传失败');
							}
							//显示图片
							headImg.src=res.data;
							image=res.data;
							console.log(image);
							$(".demo-upload-list").css("display", "inline-block");
						}
					});
				},
				methods:{
					submit() {
						//提交
						var pname = $("#pname").val();
						var detail=$("#detail").val();
						var buyPrice=$("#buyPrice").val();
						$.post("/addBuy",{pname:pname,image:image,detail:detail,buyPrice:buyPrice},function (res) {
							//添加商品成功
							alert(res.msg);
							console.dir(res);
						})
					}
				}
			});

		</script>
		<script src="js/chunk-vendors.c696eafb.js"></script>
		<div class="ivu-loading-bar" style="height: 2px; display: none;">
			<div class="ivu-loading-bar-inner ivu-loading-bar-inner-color-primary" style="width: 0%; height: 2px;"></div>
		</div><textarea wrap="soft" style="letter-spacing:normal;line-height:21px;padding-top:4px;padding-bottom:4px;font-family:&quot;Helvetica Neue&quot;, Helvetica, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, 微软雅黑, Arial, sans-serif;font-weight:400;font-size:14px;text-rendering:auto;text-transform:none;width:659.556px;text-indent:0px;padding-left:7px;padding-right:7px;border-width:1px;box-sizing:border-box;
  min-height:0 !important;
  max-height:none !important;
  height:0 !important;
  visibility:hidden !important;
  overflow:hidden !important;
  position:absolute !important;
  z-index:-1000 !important;
  top:0 !important;
  right:0 !important
"></textarea>
		<div class="ivu-message" style="top: 150px; z-index: 1050;"></div>
		<div data-v-226c5ffb="" data-transfer="true" class="v-transfer-dom">
			<div class="ivu-modal-mask" style="z-index: 1041; display: none;"></div>
			<div class="ivu-modal-wrap ivu-modal-hidden" style="z-index: 1041;">
				<div class="ivu-modal" style="width: 520px; display: none;">
					<div class="ivu-modal-content">
						<a class="ivu-modal-close"><i class="ivu-icon ivu-icon-ios-close"></i></a>
						<div class="ivu-modal-header">
							<div class="ivu-modal-header-inner">View Image</div>
						</div>
						<div class="ivu-modal-body"></div>
						<div class="ivu-modal-footer"><button type="button" class="ivu-btn ivu-btn-text ivu-btn-large"><!----> <!----> <span>取消</span></button> <button type="button" class="ivu-btn ivu-btn-primary ivu-btn-large"><!----> <!----> <span>确定</span></button></div>
					</div>
				</div>
			</div>
		</div>
	</body>

</html>